import React from 'react'
import './index.scss'
import T from 'prop-types'
import Point from '../../../components/point'
export default function List(props) {
  const { imgUrl, name, text, toDetail, time = {}, unReadNumber=0 } = props
  return (
    <div
      className="list"
      onClick={() => {
        toDetail()
      }}
    >
      <img src={imgUrl} alt="加载失败>_<"></img>
      <div className="text">
        <div>{name}</div>
        <div className="my-text">{text}</div>
      </div>
      <div className={'list-time'}>{time.time + time.text + '前'}</div>
      <div className={'list-point'}>
        <Point num={unReadNumber}></Point>
      </div>
    </div>
  )
}
List.propTypes = {
  imgUrl: T.string,
  name: T.string,
  text: T.string,
  toDetail: T.func,
  time: T.object,
  unReadNumber:T.number
}
